﻿/// <reference path="../Data/DataTemplate.js" />
// <reference path="Repeater.js" />


var $RepeaterItemType = TA.Turbo.Controls.RepeaterItemType = {
	View: 0,
	Edit: 1
};









var $RepeaterItem = TA.Turbo.Controls.RepeaterItem = function Item(owner, type, id, elements)
{
	this.DataTemplate(owner.get_Control(), owner._GetTemplateByType(type), id, elements);

	this._owner = owner;
	this._type = type;

	if (elements != null)
		this._visible = true;
}
$RepeaterItem.Inherit(TA.Turbo.Data.DataTemplate);
var _____c;
if (_____c)
{
	$RepeaterItem.prototype = new TA.Turbo.Data.DataTemplate();
}
$RepeaterItem.prototype._type = $RepeaterItemType.View;
$RepeaterItem.prototype._owner = null;
$RepeaterItem.prototype._valueIndex = null;

var ___b;
if (___b)
	$RepeaterItem.prototype._owner = new $Repeater();

$RepeaterItem.prototype.get_Owner = function get_Owner()
{
	return this._owner;
}
$RepeaterItem.prototype.get_Type = function get_Type()
{
	return this._type;
}
$RepeaterItem.prototype.get_ValueIndex = function get_ValueIndex()
{
	return this._valueIndex;
}
$RepeaterItem.prototype.set_ValueIndex = function set_ValueIndex(v)
{
	this._valueIndex = v;
}
$RepeaterItem.prototype.FireCommand = function FireCommand(command)
{
	this._owner.FireCommand(command, this);
}
$RepeaterItem.prototype.Show = function Show(containerElement, refItem)
{
	var refElement = null;
	if (refItem != null)
	{
		if (refItem.get_Elements().length > 0)
		{
			refElement = refItem.get_Elements()[0];
		}
	}
	this.TemplateInstance.Show.call(this, containerElement, refElement);
}
